import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import request from './utils/request'
import db from './utils/localstorage'
import axios from './utils/axios';
import * as func from './utils/common'
import './assets/css/style.css';
import './assets/css/iconfont.css';

import {
    Icon,
    Cell,
    CellGroup,
    loading,
    Button,
    Toast,
    RadioGroup,
    Radio
} from 'vant';

Vue.use(RadioGroup);
Vue.use(Radio);
Vue.use(Icon);
Vue.use(Cell);
Vue.use(CellGroup);
Vue.use(loading);
Vue.use(Button);
Vue.use(Toast);

Vue.use(db)
Vue.use(axios);

Vue.config.productionTip = false

Vue.prototype.$post = request.post
Vue.prototype.$get = request.get
Vue.prototype.$put = request.put
Vue.prototype.$delete = request.delete
Vue.prototype.$export = request.export
Vue.prototype.$download = request.download
Vue.prototype.$upload = request.upload
Vue.prototype.$db = db
Vue.prototype.$func = func
Vue.prototype.$goTo = func.toRedirect
Vue.prototype.$winWidth = document.documentElement.clientWidth || document.body.clientWidth;
Vue.prototype.$winHeight = document.documentElement.clientHeight || document.body.clientHeight;

new Vue({
    router,
    store,
    scrollBehavior: () => ({
        y: 0
    }), //路由跳转后页面回到顶部
    render: h => h(App),
}).$mount('#app')